package leetcode;

/**
 * 描述:75. 颜色分类
 *
 * @author Madison You
 * @created 21:24
 */
public class Mid_75_SortColors {
    public static void main(String[] args) {

    }

    public void sortColors(int[] nums) {
        int[] ints = new int[3];
        for (int i = 0; i < nums.length; i++) {
            ints[nums[i]]++;
        }
        int t = 0;
        for (int i = 0; i < ints.length; i++) {
            if (ints[i] != 0) {
                for (int j = 0; j < ints[i]; j++) {
                    nums[t++] = i;
                }
            }
        }
    }
}
